package com.web.wisdom;

import javax.servlet.MultipartConfigElement;
import javax.servlet.ServletRegistration.Dynamic;

import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer;

import com.web.config.SpringWebConfig;
/**
 * 启动
 * 该类主要是配置
 * @author Evi
 *
 */
public class SpringApplicationStarter extends AbstractAnnotationConfigDispatcherServletInitializer{

	@Override
	protected Class<?>[] getRootConfigClasses() {
		return null;
	}
//SpringMvc的servlet应用容器：servlet WebApplicationContext
//Spring推荐在该容器中，初始化应用所需要的bean，比如Service，Controller，MyBatis
	@Override
	protected Class<?>[] getServletConfigClasses() {
		return new Class<?>[] {SpringWebConfig.class};
	}
//DispatcherServlet的拦截地址，只有yiapi开头的http请求地址，才会进入到DispatcherServlet中央Servlet中去处理
	@Override
	protected String[] getServletMappings() {
		return new String[] {"/api/*"};
	}
	//
	@Override
	protected void customizeRegistration(Dynamic registration) {
		//MultipartConfigElement类是用于声明上传文件的临时目录，为空""
		registration.setMultipartConfig(new MultipartConfigElement(""));
	
	}

}
